using System.Collections.Generic;
using GorillaEngine.Particles.Effects;
using GorillaEngine.Particles.Interfaces;
using Microsoft.Xna.Framework;

namespace GorillaEngine.Core.Engine{
    public class ParticleEngine : IParticleEngine{
        public virtual List<Particle> UpdateParticles(GameTime gameTime, List<IParticle> particles){
            var effects = new List<Particle>();

            foreach (var particle in particles){
                particle.Update(gameTime);
                if (particle.TimeToLive > 0)
                    effects.Add((Particle)particle);
            }

            return effects;
        }
    }
}